package com.dx.springbootwebservice;

import com.dx.springbootwebservice.ws.GetCountryRequest;
import com.dx.springbootwebservice.ws.GetCountryResponse;
import org.springframework.ws.client.core.support.WebServiceGatewaySupport;

/**
 * @author: dx
 * @date: 2019/3/26/0026
 * @description:
 */
public class WsClient extends WebServiceGatewaySupport {
	public GetCountryResponse getCountry(String name) {
		GetCountryRequest request = new GetCountryRequest();
		request.setName(name);
		GetCountryResponse response = (GetCountryResponse) getWebServiceTemplate().marshalSendAndReceive(
				"http://localhost:8080/ws/countries.wsdl", request);
		return response;
	}
}